<template>
  <div class="container">
    <div class="loan-form">
      <div class="loan-title">您期望的贷款额度</div>
      <div class="loan-cont">
        <div
          v-for="item in itemList"
          :key="item.value"
          class="loan-item"
          :class="{ active: item.value === itemActive }"
          @click="changeItem(item)"
        >
          {{ item.name }}
        </div>
      </div>
    </div>

    <div class="loan-btn" :class="{ active: itemActive !== -1 }" @click="toNext">下一步</div>

    <footer>
      <div class="footer-title">申请资格</div>
      <ul class="footer-ul">
        <li class="footer-li">1.企业成立18个月以上</li>
        <li class="footer-li">
          2.申请人为企业企业前两大自然人股东，且年龄不超过65岁
        </li>
        <li class="footer-li">3.申请人无不良信用记录和欠缴记录。</li>
      </ul>
    </footer>
  </div>
</template>

<script>
const itemList = [
  {
    value: 0,
    name: '10万以内'
  },
  {
    value: 1,
    name: '10万-50万'
  },
  {
    value: 2,
    name: '50万-100万'
  },
  {
    value: 3,
    name: '100万以上'
  }
]

export default {
  data () {
    return {
      itemList,
      itemActive: -1
    }
  },
  mounted () {
    // this.$toast2({
    //   msg: '身份证未识别，为必传信息，请重新上传'
    // })
  },
  methods: {
    changeItem (item) {
      const { value } = item
      this.itemActive = value
    },
    toNext () {
      if (this.itemActive === -1) return
      this.$router.push({
        path: '/credential'
      })
    }
  }
}
</script>

<style lang="less" scoped>
.loan-form {
  padding: 30px;
  color: #fff;
  background-image: url("../assets/images/loan/border_pck.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-color: none;
  // border: 1px solid #fff;
  text-align: left;
}
.loan-title {
  margin: 12px 8px 36px 8px;
  font-size: 14px;
}
.loan-cont{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.loan-item {
  display: inline-block;
  width: 121px;
  height: 36px;
  line-height: 36px;
  margin: 0 8px 30px;
  font-size: 15px;
  font-weight: normal;
  background-image: url("../assets/images/loan/item.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-color: none;
  text-align: center;
  // border: 1px solid #fff;

  &.active {
    background-image: url("../assets/images/loan/item_active.png");
  }
}

.loan-btn {
  display: block;
  margin: 42px auto;
  width: 192px;
  height: 70px;
  line-height: 70px;
  // border: 1px solid #ccc;
  background-image: url("../assets/images/loan/btn.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-color: none;
  color: ccc;
  font-size: 20px;

  &.active {
    color: #fff;
    background-image: url("../assets/images/loan/btn_active.png");
  }
}

footer {
  position: absolute;
  bottom: 110px;
  font-size: 15px;
  line-height: 25px;
  text-align: left;
  .footer-li {
    font-size: 13px;
  }
}
</style>
